#include<iostream>
using namespace std;
int main()
{
	int a, b, c, t, s, i;
	cin >> t;
	for (i = 0; i < t; i++)
	{
		cin >> a >> b >> c;
		s = 2 * (a * b + b * c + a * c);
		cout << s << endl;
	}
	return 0;
}